import React from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { UserQuesProvider } from "../context/questionnaire/UserQuesContext";
import { UserProblemProvider } from "../context/questionnaire/UserProblem";
import { MyQuesProvider } from "../context/questionnaire/MyQuesContext";
import UserQuesHome from "../screens/questionnaire/userQues/UserQuesHome";
import QuesOptions from "../screens/questionnaire/userQues/QuesOptions";
import CompleteQues from "../screens/questionnaire/userQues/CompleteQues";
import CompleteProblem from "../screens/questionnaire/userQues/CompleteProblem";
import UserOpinions from "../screens/questionnaire/userQues/UserOpinions";
import ShowFileScreen from "../screens/questionnaire/ShowFileScreen";
import AddData from "../screens/questionnaire/userQues/AddData";
import { Feather } from "@expo/vector-icons";
const Stack = createNativeStackNavigator();

const UserQuesNavigation = ({ navigation }) => {
  return (
    <UserProblemProvider>
      <UserQuesProvider>
        <MyQuesProvider>
          <Stack.Navigator
            initialRouteName="Questionnaire"
            screenOptions={{
              headerTitleAlign: "center",
              headerTintColor: "#fff",
              headerStyle: {
                backgroundColor: "#A80108",
              },
            }}
          >
            <Stack.Screen
              name="问卷填写"
              component={UserQuesHome}
              options={{
                headerShown: true,
                headerLeft: () => (
                  <Feather
                    name="user"
                    style={{ padding: 5 }}
                    size={25}
                    color="#fff"
                    onPress={() => navigation.openDrawer()}
                  />
                ),
              }}
            />
            <Stack.Screen
              name="问卷操作"
              component={QuesOptions}
              // options={{ headerShown: false }}
            />
            <Stack.Screen
              name="填写问卷"
              component={CompleteQues}
              // options={{ headerShown: false }}
            />
            <Stack.Screen
              name="问题清单"
              component={CompleteProblem}
              // options={{ headerShown: false }}
            />
            <Stack.Screen
              name="意见反馈"
              component={UserOpinions}
              // options={{ headerShown: false }}
            />
            <Stack.Screen
              name="添加入户资料"
              component={AddData}
              // options={{ headerShown: false }}
            />
            <Stack.Screen
              name="入户资料"
              component={ShowFileScreen}
              // options={{ headerShown: false }}
            />
          </Stack.Navigator>
        </MyQuesProvider>
      </UserQuesProvider>
    </UserProblemProvider>
  );
};

export default UserQuesNavigation;
